package edu.iss.demo.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the employee database table.
 * 
 */
@Entity
@NamedQuery(name="Employee.findAll", query="SELECT e FROM Employee e")
public class Employee implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="employee_id")
	private String employeeId;

	private String address;

	private int AL_Balance;

	private int CL_Balance;

	@Column(name="contact_no")
	private String contactNo;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="date_hired")
	private Date dateHired;

	private String designation;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dob;

	@Column(name="manager_id")
	private String managerId;

	private int ML_Balance;

	private String name;

	private String password;

	private String role;

	//bi-directional many-to-one association to CompensationLeave
	@OneToMany(mappedBy="employee")
	private List<CompensationLeave> compensationLeaves;

	//bi-directional many-to-one association to LeaveApplication
	@OneToMany(mappedBy="employee")
	private List<LeaveApplication> leaveApplications;

	public Employee() {
	}

	public String getEmployeeId() {
		return this.employeeId;
	}

	public void setEmployeeId(String employeeId) {
		this.employeeId = employeeId;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getAL_Balance() {
		return this.AL_Balance;
	}

	public void setAL_Balance(int AL_Balance) {
		this.AL_Balance = AL_Balance;
	}

	public int getCL_Balance() {
		return this.CL_Balance;
	}

	public void setCL_Balance(int CL_Balance) {
		this.CL_Balance = CL_Balance;
	}

	public String getContactNo() {
		return this.contactNo;
	}

	public void setContactNo(String contactNo) {
		this.contactNo = contactNo;
	}

	public Date getDateHired() {
		return this.dateHired;
	}

	public void setDateHired(Date dateHired) {
		this.dateHired = dateHired;
	}

	public String getDesignation() {
		return this.designation;
	}

	public void setDesignation(String designation) {
		this.designation = designation;
	}

	public Date getDob() {
		return this.dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public String getManagerId() {
		return this.managerId;
	}

	public void setManagerId(String managerId) {
		this.managerId = managerId;
	}

	public int getML_Balance() {
		return this.ML_Balance;
	}

	public void setML_Balance(int ML_Balance) {
		this.ML_Balance = ML_Balance;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return this.role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public List<CompensationLeave> getCompensationLeaves() {
		return this.compensationLeaves;
	}

	public void setCompensationLeaves(List<CompensationLeave> compensationLeaves) {
		this.compensationLeaves = compensationLeaves;
	}

	public CompensationLeave addCompensationLeave(CompensationLeave compensationLeave) {
		getCompensationLeaves().add(compensationLeave);
		compensationLeave.setEmployee(this);

		return compensationLeave;
	}

	public CompensationLeave removeCompensationLeave(CompensationLeave compensationLeave) {
		getCompensationLeaves().remove(compensationLeave);
		compensationLeave.setEmployee(null);

		return compensationLeave;
	}

	public List<LeaveApplication> getLeaveApplications() {
		return this.leaveApplications;
	}

	public void setLeaveApplications(List<LeaveApplication> leaveApplications) {
		this.leaveApplications = leaveApplications;
	}

	public LeaveApplication addLeaveApplication(LeaveApplication leaveApplication) {
		getLeaveApplications().add(leaveApplication);
		leaveApplication.setEmployee(this);

		return leaveApplication;
	}

	public LeaveApplication removeLeaveApplication(LeaveApplication leaveApplication) {
		getLeaveApplications().remove(leaveApplication);
		leaveApplication.setEmployee(null);

		return leaveApplication;
	}

}